package com.sanrenzu.chunbo.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.sanrenzu.chunbo.R;
import com.sanrenzu.chunbo.bean.zxb.QiangGouChildBean;
import com.sanrenzu.chunbo.bean.zxb.ShuiGuoChildBean;
import com.sanrenzu.chunbo.ui.vertical.fenlei.FenLeiActivity;

import java.util.List;

/**
 * Created by My on 2016/9/1.
 */
public class GengDuoListView extends BaseAdapter{

    private List<ShuiGuoChildBean> list = null;
    private Context context;
    private LayoutInflater inflater;
    public String id = "";

    public GengDuoListView(Context context, List<ShuiGuoChildBean> list) {
        this.context = context;
        this.list = list;
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView( int position, View convertView, ViewGroup parent) {
        mViewHolder mHolder = null;
        if(convertView==null){
            convertView = inflater.inflate(R.layout.activity_gengduo,parent,false);
            mHolder = new mViewHolder(convertView);
            convertView.setTag(mHolder);
        }else {
            mHolder = (mViewHolder) convertView.getTag();
        }


        mHolder.gengduo_listview.setText(list.get(position).getClassName());

        return convertView;
    }

    class mViewHolder {
        TextView gengduo_listview;

        public mViewHolder(View convertView) {
            gengduo_listview = (TextView) convertView.findViewById(R.id.gengduo_listview);

        }
    }
}
